package cn.codeinn.service1.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;

@Api
@RestController
@RequestMapping(value = "/nacosConfig")
@RefreshScope
public class NacosConfigController {

	@Value(value = "${test.key1:}")
	private String key1;
	@Value("${test.key2:}")
	private String key2;

	@GetMapping(value = "/getKey1")
	public String testGetKey1() {
		return key1;
	}

	@GetMapping(value = "/getKey2")
	public String testGetKey2() {
		return key2;
	}

}
